import request from '@/utils/request';

// 获取标签列表
export function getTags() {
  return request({
    url: '/tags/list',
    method: 'get'
  });
}

// 创建标签
export function createTag(data) {
  return request({
    url: '/tags',
    method: 'post',
    data
  });
}

// 更新标签
export function updateTag(data) {
  return request({
    url: `/tags/${data.tagId}`,
    method: 'put',
    data
  });
}

// 删除标签
export function deleteTag(id) {
  return request({
    url: `/tags/${id}`,
    method: 'delete'
  });
}

// 新增：切换热门状态
export function toggleTagHotStatus(id, isHot) {
  return request({
    url: `/admin/tags/${id}/hot`,
    method: 'put',
    params: { isHot }
  });
}